﻿@model KL.Store.Web.Models.SalesModel
@{
    ViewBag.Title = "Satış Listesi";
    Layout = "~/Views/Shared/_LayoutReportPanel.cshtml";
    var IdAmbar = ViewBag.IdAmbar;
    DateTime BasTar = ViewBag.BasTar;
    DateTime BitTar = ViewBag.BitTar;
    var DovizId = ViewBag.DovizId;
}
<h2>Satış Listesi</h2>
<hr />
<div class="col-xs-12 first last">
    <form action="/ReportPanel/LookSales" method="get">
        <ul class="SaleFilter">
            <li class="col-md-2">
                <label for="IdAmbar">Ambar Seçimi</label>
                <select name="IdAmbar" id="IdAmbar" class="form-control">
                    <option value="0" @{if (IdAmbar == 0)
                                        {<text>selected="selected"</text>}}>Tümü</option>
                    @foreach (var ambar in Model.AmbarList)
                    {
                        <option value="@(ambar.IdAmbar)" @{if (IdAmbar == ambar.IdAmbar)
                                                           {<text>selected="selected"</text>}}>@(ambar.AmbarAdi)</option>
                    }
                </select>
            </li>
            <li class="col-md-2">
                <div class="input-group date">
                    <label for="datetimepicker1">Başlangıç Tarihi</label>
                    <input type="text" name="BasTar" class="form-control" id="datetimepicker1" value="@(String.Format("{0:yyyy/MM/dd HH:mm}", BasTar))" />
                </div>
            </li>
            <li class="col-md-2">
                <div class="input-group date">
                    <label for="datetimepicker1">Bitiş Tarihi</label>
                    <input type="text" name="BitTar" class="form-control" id="datetimepicker2" value="@(String.Format("{0:yyyy/MM/dd HH:mm}", BitTar))" />
                </div>
            </li>
            <li class="col-md-2">
                <label for="DovizId">Para Birimi</label>
                <select name="DovizId" id="DovizId" class="form-control">
                    <option value="TL" @{if (DovizId == "TL")
                                         {<text>selected="selected"</text>}}>TL</option>
                    <option value="USD" @{if (DovizId == "USD")
                                          {<text>selected="selected"</text>}}>USD</option>
                    <option value="EUR" @{if (DovizId == "EUR")
                                          {<text>selected="selected"</text>}}>EUR</option>
                </select>
            </li>
            <li class="col-md-2">
                <label style="display: block;">&nbsp;</label>
                <button type="submit" class="btn btn-default">Listele</button>
            </li>
        </ul>
    </form>
</div>
<div class="clearfix"></div>
@if (IdAmbar != null && BasTar != DateTime.MinValue && BitTar != DateTime.MinValue && !string.IsNullOrEmpty(DovizId))
{
    <div class="col-xs-12 hidden-md hidden-lg  first last"><span class="hidden-md hidden-lg right"><a href="javascript:void(0);" class="sectionOC" onclick="expandSection('#lookSales');">Genişlet/Daralt&nbsp;<i class="fa fa-bars"></i></a></span></div>
    <div class="col-md-10 first last" id="lookSales">
        <hr />
        @{Html.RenderAction("LookSalesGet", "ReportPanel", new { IdAmbar = IdAmbar, BasTar = BasTar, BitTar = BitTar, DovizId = DovizId }); }
    </div>
}
else
{
    <div class="col-md-10 first last">
        <hr />
        <div class="alert alert-info" role="alert"><i class="glyphicon glyphicon-info-sign"></i>&nbsp;Satış listesini görebilmek için yukarıdan şube, tarih ve döviz tipi seçiniz.</div>
    </div>
}